package com.wufan.day08.java1;

import java.util.Date;

/**
 * @author SongWufan
 * @date 2022/5/21 18:07
 */
public class EqualsTest {
    public static void main(String[] args) {
        int i = 10;
        int j = 10;
        double d = 10.0;
        System.out.println(i == j);
        System.out.println(i == d);
        boolean b = true;
        char c = 10;
        System.out.println(i == c);
        char c1 = 'A';
        char c2 = 65;
        System.out.println(c1 == c2);

        Customer customer1 = new Customer();
        customer1.setName("Tom");
        customer1.setAge(21);
        Customer customer2 = new Customer();
        customer2.setName("Tom");
        customer2.setAge(21);
        System.out.println(customer1 == customer2);
        //false
        System.out.println(customer1.equals(customer2));
        //true
        String string1 = "wufan";
        String string2 = "wufan";
        System.out.println(string1.equals(string2));
        Date date1 = new Date(123456789);
        Date date2 = new Date(123456789);
        System.out.println(date1.equals(date2));
    }
}
